<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ProcesarAmonestacion
 *
 * @author MFerreira
 */
class ProcesarAmonestacion extends Module {

    public function index() {
        $Amonestaciones = array();
        $Amonestaciones = $this->model->reports->GetByEstado(0);

        $this->assign("Amonestaciones", $Amonestaciones);
        $this->display();
    }

    /**
     * @export-metadata Bind:this.Reporte
     */
    public function Responder() {
        if ($this->request->submitted()) {
            
            $this->Reporte->setEstadoReporte(TipoReporte::Retiro);

            $this->model->reports->Update($this->Reporte);
            $this->display();
        } else {
            $this->index();
        }
    }

    private $Reporte;

    public function getReporte() {
        if (!$this->Reporte) {
            $this->Reporte = new Reportes();
        }
        return $this->Reporte;
    }

}

?>
